package net.sx.minemodule.mvp.model;

import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseItem;
import com.kedll.library.mvp.BaseModel;

import net.sx.minemodule.mvp.item.MedalListItem;

/**
 * 奖牌明细model 数据请求成功放入此类
 */
public class MineMedalListModel extends BaseModel {

    /**
     * id : 10
     * memberId : 23                //前台用户
     * medalType : 0                //方式
     * medalNum : 6                 //奖牌数量
     * createTime : 2020-07-10      //时间
     * inOrOut                      //获得或者消耗
     */

    private int id;
    private int memberId;
    private int medalType;
    private int medalNum;
    private String createTime;

    private String inOrOut;

    public String getInOrOut() {
        return medalNum > 0 ? "获得奖牌" : "消耗奖牌";
    }

    public void setInOrOut(String inOrOut) {
        this.inOrOut = inOrOut;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMemberId() {
        return String.valueOf(memberId);
    }

    public void setMemberId(int memberId) {
        this.memberId = memberId;
    }

    public String getMedalType() {
        return medalType == 1 ? "兑换" : "购物";
    }

    public void setMedalType(int medalType) {
        this.medalType = medalType;
    }

    public String getMedalNum() {
        return String.valueOf(medalNum);
    }

    public void setMedalNum(int medalNum) {
        this.medalNum = medalNum;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Override
    public BaseItem createItem(MultiTypeAdapter adapter) {
        return new MedalListItem(this);
    }
}
